import * as actionTypes from '../constants'

// 保存用户信息的action
export const createUserAction = (userObj) => {

  localStorage.setItem('user',JSON.stringify(userObj.user))
  localStorage.setItem('token',userObj.token)

  return {
    type:actionTypes.SAVE_USER_INFO,
    data:userObj
  }
}

// 退出登录的action
export const deleteUserAction = () => {
  localStorage.clear()

  return {
    type:actionTypes.DELETE_USER_INFO,
    data:''
  }
}

